package org.example.wine.boot.config;

import org.example.wine.boot.interceptors.LoginInterceptors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


/**
 * @author Administrator
 * @date 2023/03/06
 * 全局拦截器配置
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Autowired
    private LoginInterceptors loginInterceptors;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //添加登录拦截器  取消指定接口登录拦截
        registry.addInterceptor(loginInterceptors).excludePathPatterns("/user/login", "/user/register");
    }
}
